﻿@model IEnumerable<VehicleManagement.Models.Applicant>
@{
    ViewBag.Title = "Index";
}
<script src="@Url.Content("~/Scripts/SetPagingScript.js")" type="text/javascript"></script>
<script type="text/javascript">

    $(function () {
        if ($.query.get("Page") != "") {
            $("#Page").val($.query.get("Page"));
        }
        else {
            $("#Page").val(1);
        }

        if ($.query.get("Name") != "" && !$.query.get("Name")) {
            $("input[name='Name']").val($.query.get("Name"));
        }

        if ($.query.get("Telephone") != "" && !$.query.get("Telephone")) {
            $("input[name='Telephone']").val($.query.get("Telephone"));
        }

        if ($.query.get("Sex") != "" && !$.query.get("Sex")) {
            $("input[name='Sex']").val($.query.get("Sex"));
        }

        $.get("/Applicant/GetPagingInfo",
            {
                Name: $("input[name='Name']").val(),
                Telephone: $("input[name='Telephone']").val(),
                Sex: $("input[name='Sex']").val(),
                Page: $("#Page").val()
            },
            function (data) {
                $("#TotalItems").text(data.TotalItems);
                $("#ItemsPerPage").text(data.ItemsPerPage);
                $("#TotalPages").text(data.TotalPages);
                $("#CurrentPage").text($("#Page").val());
            }
        );
        SetPagingOperation();
    });
</script>
<div class="mas">
    <div class="toptitle">
        系统管理员管理平台
    </div>
    @*<div class="car"></div>*@
    @Html.Partial("_PartviewAdmin")
    <div class="rightshow">
        <div class="wrap-right">
            <div class="classifyinfo">
                <div class="system-location">
                    <a>管理系统</a>>><a>管理员管理</a>>><a>申请人管理</a>
                </div>
                <div class="system-Userinfo">
                    <span class="space">当前用户:</span><a>张测试</a><span class="space">部门:</span><a>技术部</a><a
                        class="space">退出</a>
                </div>
                <div class="clear">
                </div>
            </div>
            <div class="applicantctrol ">
            </div>
            <div class="createrecordp">
                <div class="createrecord_pbc">
                    <div class="createrecord_pbc1">@Html.ActionLink("添加申请人", "Create")</div>
                </div>
            </div>
            <div class="sort-content">
                <div class="sort-bar">
                    <div class="sort-bar-item">
                        人员条件筛选：
                    </div>
                    @using (Html.BeginForm("Index", "Applicant", FormMethod.Get, new { id = "SearchForm" }))
                    {
                        @Html.Hidden("Page");
                        <div class="sort-bar-item1">
                            <input id="key" name="Name" type="text" value="姓名" class="ipt-2" /><input type="submit"
                                value="" class="btn-2" />
                        </div>
                        <div class="sort-bar-item1">
                            <input id="Text1" name="Telephone" type="text" value="电话" class="ipt-2" /><input
                                type="submit" value="" class="btn-2" />
                        </div>
                        <div class="sort-bar-item1">
                            <input id="Text2" name="Sex" type="text" value="性别" class="ipt-2" /><input type="submit"
                                value="" class="btn-2" />
                        </div>
                        <div class="sort-bar-item2">
                            <input id="Text3" name="key" type="text" value="模糊查找" class="ipt-2" /><input type="submit"
                                value="" class="bt-n2" />
                        </div>
                    }
                    <div class="clear">
                    </div>
                </div>
                <div class="sort-info">
                    @foreach (var item in Model)
                    {
                        <div class="sort-info1">
                            <div class="img-wrap">

                                @if (string.IsNullOrWhiteSpace(item.Image))
                                {
                                    <img src="../../Content/themes/base/DMSource/png-0840.png" />
                                }
                                else
                                {
                                    <img src="/Photos/Applicant/@item.Image" />
                                }
                            </div>
                            <div class="sort-info-text">
                                <div class="sort-info-line1">
                                    <div class="sort-info-a">
                                        <a>@Html.DisplayFor(model => item.Name)</a></div>
                                    <div class="sort-info-btn1">@Html.ActionLink("编辑", "Edit", new { id = item.ApplicantID })</div>
                                    <div class="sort-info-btn2">
                                        @Html.ActionLink("查看", "Details", new { id = item.ApplicantID })</div>
                                    <div class="sort-info-btn2">
                                        <a href="javascript:void(0)" onclick="DeleteApplicant(@item.ApplicantID)">删除</a></div>
                                    <div class="clear">
                                    </div>
                                </div>
                                <div class="sort-info-line2">
                                    <span>@Html.LabelFor(model => item.Email)</span> <a>@Html.DisplayFor(model => item.Email)</a>
                                    <span class="sort-info-span2">@Html.LabelFor(model => item.Telephone)</span> <a>@Html.DisplayFor(model => item.Telephone)</a>
                                </div>
                            </div>
                            <div class="clear">
                            </div>
                        </div>
           
                    }
                </div>
            </div>
        </div>
    </div>

    <div class="clear">
    </div>
        <div>
    共<span id="TotalItems"></span>条记录， 每页显示<span id="ItemsPerPage"></span>条， 共<span id="TotalPages"></span>页，
    当前第<span id="CurrentPage"></span>页 <a id="FirstPage" href="javascript:void(0)">首页</a>
    <a id="PrevPage" href="javascript:void(0)">上一页</a> <a id="NextPage" href="javascript:void(0)">
        下一页</a> <a id="LastPage" href="javascript:void(0)">末页</a> <span>跳转到</span>
    <input type="text" id="PageToGo" />
    <input type="button" id="GoToPage" value="Go" />
</div>
</div>
